#pragma once

#include "Node.h"
#include <vector>
using namespace std;

class DesignEntityTable{
public:
	/** Constructor
	 * Initialize all Design Entity indexes/tables.
	 */
	DesignEntityTable();

	/**
	 * Add a new node of Assign design entity.
	 * @param assignDE node of Assign design entity.
	 * @return true if added successfully, else false.
	 */
	bool addAssignDe(Node* assignDE);

	/**
	 * Add a new node of Constant design entity.
	 * @param constantDE node of Constant design entity.
	 * @return true if added successfully, else false.
	 */
	bool addConstantDe(Node* constantDE);

	/**
	 * Add a new node of If design entity.
	 * @param assignDE node of If design entity.
	 * @return true if added successfully, else false.
	 */
	bool addIfDe(Node* ifDE);

	/**
	 * Add a new node of While design entity.
	 * @param assignDE node of While design entity.
	 * @return true if added successfully, else false.
	 */
	bool addWhileDe(Node* whileDE);

	/**
	 * Get all Assign design entity nodes from the index.
	 * @return a list of all nodes with Assign design entity.
	 */
	vector<Node*> getAssignDe();

	/**
	 * Get all Constant design entity nodes from the index.
	 * @return a list of all nodes with Constant design entity.
	 */
	vector<Node*> getConstantDe();

	/**
	 * Get all If design entity nodes from the index.
	 * @return a list of all nodes with If design entity.
	 */
	vector<Node*> getIfDe();

	/**
	 * Get all While design entity nodes from the index.
	 * @return a list of all nodes with While design entity.
	 */
	vector<Node*> getWhileDe();

	/**
	 * Clear all records in the design entity tables.
	 */
	void clearAll();
	
private:
	vector<Node*> AssignDEIndex; /**< A index or table used to store all Assign design entity nodes*/
	vector<Node*> ConstantDEIndex; /**< A index or table used to store all Constant design entity nodes*/
	vector<Node*> IfDEIndex; /**< A index or table used to store all If design entity nodes*/
	vector<Node*> WhileDEIndex; /**< A index or table used to store all While design entity nodes*/
};
